<div id='catalog'>
	{if $topGroups}
		<div class='cat_names'>
		{foreach $topGroups as $group}
			<a href='/catalog/{$group->code()}' {if $group->id()==$cat->id()}class='current'{/if}>{$group->name()}</a>	
		{/foreach}	
		</div>
	{/if}
	<div class='cat_names'>
	{foreach $groups as $group}
		<a href='#{$group.code}'>{$group.name}</a>
	{/foreach}
	</div>
{foreach $groups as $group}
	<a name='{$group.code}'></a><h1>{$group.name}</h1>
	<table>
		<tr>
			{foreach $products[$group.id] as $product}
				{if $product@index % 3 == 0}
					</tr>
					<tr>
				{/if}
				{capture assign='pnm'}{$product->name()} {$product->model()}{/capture}
				<td>
					<div class='catitem'>
						<div>
							<a href='/details/{$product->code()}'>
								<img src='{thumbnail width=190 height=145}{$product->image()}{/thumbnail}' title='{$pnm}' alt='{$pnm}'>
								{if $product->isInGroup('discount15')}
									<img class='discount' src="/images/discount15.png"/>
								{elseif $product->isInGroup('discount30')}
									<img class='discount' src="/images/discount30.png"/>
								{/if}
							</a>
						</div>
					</div>
					<div class='itemnm'>
						<a href='/details/{$product->code()}' title='{$pnm}'>{$pnm}</a>
						<div class='details'>
							<a href='/details/{$product->code()}'>подробнее...</a>
						</div>
					</div>
				</td>
			{/foreach}
			{for $i=2 to $product@total%3}
				<td>&nbsp;</td>
			{/for}
		</tr>
	</table>
{/foreach}
</div>
{$cat->descr()}